﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PubNubNotificator
{
    public static class PubNubNotificationSender
    {
        static PubNubApi pubnub = new PubNubApi(
                "pub-c-d9b56413-5a7f-4528-9e32-6324f449b10e",               // PUBLISH_KEY
                "sub-c-361a1a54-04c1-11e3-a005-02ee2ddab7fe",               // SUBSCRIBE_KEY
                "sec-c-Nzg4NzM2ZjMtYjg4OS00ODVlLTk3ZDYtMjNkM2QwYjc2OGMy",   // SECRET_KEY
                true                                                        // SSL_ON?
            );
        static string channel = "my_channel";

        static public void Send(object obj)
        {
            string msg = JsonConvert.SerializeObject(obj);
            pubnub.Publish(channel, msg);
        }
    }
}
